// 角色管理
export const roleThead = [
  {
    type: 'selection',
    width: 60,
    align: 'center'
  },
  {
    title: '角色名称',
    key: 'name'
  },
  {
    title: '角色状态',
    key: 'enabled',
    render: (h, params) => {
      const text = params.row.enabled === true ? '启用' : '禁用'
      return h('span', text)
    }
  },
  {
    title: '数据权限',
    key: 'dataAccessRoleTypeName'
  },
  {
    title: '角色分类',
    key: 'operationRoleTypeName'
  },
  {
    title: '创建时间',
    key: 'createdOn',
    render: (h, params) => {
      const text = params.row.createdOn ? params.row.createdOn.slice(0, 10) + ' ' + params.row.createdOn.slice(11, 19) : ''
      return h('span', text)
    }
  },
  {
    title: '操作',
    width: 300,
    align: 'center',
    key: 'action',
    slot: 'action',
    fixed: 'right'
  }
]

// 绑定账号
export const roleBindThead = [
  {
    type: 'selection',
    width: 60,
    align: 'center'
  },
  {
    title: '账号名称',
    key: 'name'
  },
  {
    title: '登录名称',
    key: 'userName'
  },
  {
    title: '手机号码',
    key: 'phone'
  },
  {
    title: '所属公司',
    key: 'companyName'
  },
  {
    title: '角色状态',
    key: 'enabled',
    render: (h, params) => {
      const text = params.row.enabled === true ? '启用' : '禁用'
      return h('span', text)
    }
  },
  {
    title: '创建时间',
    key: 'createdOn',
    width: 200
    // render: (h, params) => {
    //   const text = params.row.createdOn ? params.row.createdOn.slice(0, 10) : ''
    //   return h('span', text)
    // }
  }
]
